from django.db import models

# Create your models here.
#如果你想跟另外一个app的模型进行关联  需要 app.模型名称
class Article(models.Model):
    title = models.CharField(max_length=100, blank=True, null=True)
    content = models.TextField(blank=True, null=True)
    author = models.ForeignKey('front.User',models.SET_NULL,blank=True, null=True)
    tags = models.ManyToManyField("Tag",db_table='article_tag')
    #db_table 手动指定中间表的名字
    class Meta:
        db_table = 'article'

class Tag(models.Model):
    name = models.CharField(max_length=100, blank=True, null=True)
    class Meta:
        db_table = 'tag'